# -*- coding: utf-8 -*- 

db = DAL('sqlite://storage.sqlite')       # use SQLite or other DB

from gluon.tools import *

auth=Auth(globals(),db)                      # authentication/authorization
auth.settings.hmac_key='sha512:cc2a6848-7bf8-40ad-8212-c69f5d0e57ad'
auth.define_tables()                         # creates all needed tables

#service=Service(globals())                   # for json, xml, jsonrpc, xmlrpc, amfrpc
#crud=Crud(globals(),db)                      # for CRUD helpers using auth
# crud.settings.auth=auth                      # enforces authorization on crud
# auth.settings.mailer=mail                    # for user email verification
# auth.settings.registration_requires_verification = True
# auth.settings.registration_requires_approval = True
# auth.messages.verify_email = \
#  'Click on the link http://.../user/verify_email/%(key)s to verify your email'
# auth.settings.reset_password_requires_verification = True
# auth.messages.reset_password = \
#  'Click on the link http://.../user/reset_password/%(key)s to reset your password'
## more options discussed in gluon/tools.py
#########################################################################

#########################################################################
## Define your tables below, for example
##
## >>> db.define_table('mytable',Field('myfield','string'))
##
## Fields can be 'string','text','password','integer','double','boolean'
##       'date','time','datetime','blob','upload', 'reference TABLENAME'
## There is an implicit 'id integer autoincrement' field
## Consult manual for more options, validators, etc.
##
## More API examples for controllers:
##
## >>> db.mytable.insert(myfield='value')
## >>> rows=db(db.mytable.myfield=='value').select(db.mytable.ALL)
## >>> for row in rows: print row.id, row.myfield
#########################################################################
